package ModelLayer;
import java.util.ArrayList;
import java.util.Date;

/**
 * This class is the order class and contains suborders.
 * 
 * @author Gruppe 4 
 * @version 5. juni 2012
 */
public class Order
{
    // Instance variables
    private int orderNo;
    private int status;    
    private double totalPrice;
    private Date date;
    private double discountPrice;
    private Customer customer;
    private Salesman salesman;
    private ArrayList<SubOrder> subOrderList;   
     
    /**
     * The constructor of this class takes input parameters.
     */
    public Order(int inputOrderNo, int inputStatus, Date inputDate)
    {
        this.orderNo = inputOrderNo;
        this.status = inputStatus;
        this.totalPrice = 0.0;
        this.date = inputDate;
        this.discountPrice = 0;
        this.customer = null;
        this.salesman = null;
        subOrderList = new ArrayList<SubOrder>();
    }

    /**
     * Set and get methods.
     */
    public int getOrderNo()
    {
        return orderNo;
    }
    
    public int getStatus()
    {
        return status;
    }
    
    public double getTotalPrice()
    {
        return totalPrice;
    }
    
    public Date getDate()
    {
        return date;
    }
    
    public double getDiscountPrice()
    {
        return discountPrice;
    }
    
    public Customer getCustomer()
    {
        return customer;
    }
    
    public Salesman getSalesman()
    {
        return salesman;
    }
    
    public ArrayList<SubOrder> getSubOrders() {
        return subOrderList;
    }
    
    public void setDiscountPrice(double discountPrice)
    {
        this.discountPrice = discountPrice;
    }
    
    public void setTotalPrice(double totalPrice)
    {
        this.totalPrice = totalPrice;
    }
    
    public void setStatus(int status) {
        this.status = status;
    }
    
    public void addCustomer(Customer customer)
    {
        this.customer = customer;
    }
    
    public void addSalesman(Salesman salesman)
    {
        this.salesman = salesman;
    }
    
    public void addSubOrder(SubOrder subOrder)
    {
        subOrderList.add(subOrder);
    }
}